package net.crowdloud.client.problem;

import net.crowdloud.shared.entities.Problem;
import net.crowdloud.shared.entities.User;

import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.RootPanel;

/**
 * 
 * @UserManual
 */
public class ButtonProblem extends Button {

	public ButtonProblem(final User user) {

		this.setText("Add a Need");

		this.addClickHandler(new ClickHandler() {

			@Override
			public void onClick(ClickEvent event) {

				RootPanel.get().clear();
				RootPanel.get().add(new ProblemForm(user, new Problem()));

			}
		});
	}
}
